<?php
class Validator {
    private $db;
    function __construct($db) {
        $this->db = $db;
    }

    public function username_avaliable($value, $empty, &$params, &$formvars){
     $userRepository=new UserRepository();
     return !$userRepository->checkUserExistance($this->db, $value);
    }
      public function email_avaliable($value, $empty, &$params, &$formvars){
     $userRepository=new UserRepository();
     return !$userRepository->checkEmailExistance($this->db, $value);
    }
}
?>
